<?php

namespace App\Exceptions;

use App\Kuafu\Base\Enum\BaseCodeEnum;
use Illuminate\Contracts\Validation\Validator;
use Throwable;

class CustomValidateException extends BaseException
{

    const VALIDATE_PARAMS_ERROR_CODE = BaseCodeEnum::ERR_400000;

    /**
     * @param Validator $validator
     */
    public function __construct(Validator $validator)
    {
        parent::__construct(self::VALIDATE_PARAMS_ERROR_CODE, $validator->errors()->first());
    }

}
